<?

//Initiate Authenticate
SecurityRedirect ();

//initiate Vars
define("PRIMARY_KEY","skada");
$KEY[]         = array("PRIMARY_KEY"=>PRIMARY_KEY);
$FileName      = "ais_report_dn_voucher.php";
$FileTemplate  = "ais_report_dn_voucher_list.html";
$TableName     = "ais_piutang";
$SubHeaderTitle= "Report - Debit/Credit Note Summary";
$PageSize      = 10 ;
$HTMLGridList  = "ToolGrid";

//************ FORM ACTION **************
if (GetParam("Action","")=="Delete") {
   DeleteRecord ("txtCheck",$PageSize);
}

//Initiate Database Table For Search;
$fromTransNo = GetParam("fromTransNo","");
$toTransNo = GetParam("toTransNo","");
$currFilter = GetParam("curr","");
$vesselFilter = GetParam("vessel","");
$voyageFilter = GetParam("voyage","");
$officeFilter = GetParam("office","");


//******* DATABASE FORM QUERY ***********
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate($MOD_TEMPLATE_DIR."/".$FileTemplate);
$TBS->MergeBlock("officeformblk",$DBConnection->GetConnection1(),"SELECT * FROM tblkantor");
$TBS->MergeBlock("bln",$KEY);
$TBS->Show();


function DeleteRecord ($sequence_name,$PageSize) {
        global $DBConnection,$FileName,$TableName;
        for ($x=1;$x<=$PageSize;$x++) {
                if (GetParam($sequence_name.$x,""))        {
                        $DBConnection->Delete("$TableName",$sequence_name.$x);
            }
        }
        header("Location: $FileName");
        exit;

}

?>
